package com.vrv.liteflow.cmps;

import com.alibaba.fastjson.JSONObject;
import com.yomahub.liteflow.core.NodeComponent;
import org.springframework.stereotype.Component;

/**
 * @author Bang
 * @ClassName: EndCmp
 * @Desc: TODO
 * @Date: 2023/11/01 16:46
 * @Version: 1.0
 * @Modified By:
 */
@Component("end")
public class EndCmp extends NodeComponent {
    @Override
    public void process() throws Exception {
        String requestData = this.getRequestData();
        JSONObject contextBean = this.getContextBean(JSONObject.class);
        String nodeId = this.getNodeId();
        contextBean.put(nodeId, nodeId.concat(" ").concat(requestData));
        System.out.println(nodeId);
        if ("end".equals(requestData)) {
            // 结束后续的流程
            this.setIsEnd(true);
        }
    }
}
